package cn.regexp.seckill.feign;


import cn.regexp.common.core.domain.Product;
import cn.regexp.common.core.web.Result;
import cn.regexp.seckill.feign.fallback.ProductFeignFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author Regexpei
 * @date 2024/7/5 23:20
 * @description 商品feign服务
 */
@Component
@FeignClient(name = "lego-shop-service-product", fallback = ProductFeignFallback.class)
public interface ProductFeignApi {
    /**
     * 获取秒杀商品对应的商品信息
     *
     * @param ids 商品ID
     * @return 商品列表
     */
    @PostMapping("/product/queryProductByIds")
    Result<List<Product>> queryProductByIds(@RequestParam("ids") List<Long> ids);
}
